//
//  BindInfoViewController.m
//  TenMinDemo
//
//  Created by Shawn Li on 2021/3/9.
//  Copyright © 2021 CYXiang. All rights reserved.
//

#import "BindInfoViewController.h"
#import "ChangeBingInfoController.h"
#import "BottomPopPromptView.h"

@interface BindInfoViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *bgIcon;
@property (weak, nonatomic) IBOutlet UILabel *infoShow;
@property (weak, nonatomic) IBOutlet UILabel *subInfo;

@end

@implementation BindInfoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self configPage];
}

- (void)configPage{
    if (self.bindInfoType == 0) {
        self.title = LCLocalString(@"binged_sjh");
        self.bgIcon.image = [UIImage imageNamed:@"bing_phone_bg"];
        
        NSString *info = [NSString stringWithFormat:@"%@: ",LCLocalString(@"binged_sjh")];
        NSMutableAttributedString *phoneStr = LCAttStr(info, [UIFont systemFontOfSize:16 weight:UIFontWeightMedium], [UIColor colorWithHexString:@"#929acc"]);
        
        [phoneStr appendAttributedString:LCAttStr(kAppDelegate.curUser.phone, [UIFont systemFontOfSize:15 weight:UIFontWeightMedium], [UIColor whiteColor])];
        
        self.infoShow.attributedText = phoneStr;
        
        self.subInfo.text = @"如果你的通讯中有朋友注册了hashspace,系统会联系你。";
    }else if (self.bindInfoType == 1){
        self.title = @"绑定邮箱";
        self.bgIcon.image = [UIImage imageNamed:@"bing_mail_bg"];
        self.infoShow.text = @"绑定的邮箱：198@qq.com";
        self.subInfo.text = @"";
    }
}
- (IBAction)optAction:(id)sender {
    
    
    BottomPopPromptView *view = [[BottomPopPromptView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREENH_HEIGHT)];
    LRWeakSelf(self);
    view.actionBlock = ^(NSInteger index) {
        CYXLog(@"%zd",index);
        if(index == 0 ){
            
        }else if (index == 1){
            ChangeBingInfoController *vc = LoadVCFormXib(ChangeBingInfoController);
            vc.bindInfoType = self.bindInfoType;
            [self.navigationController pushViewController:vc animated:YES];
        }
    };
    
    [view showInView:self.navigationController.view];
    
}



@end
